package lion.dev.lang;

import java.util.List;

import lion.dev.web.Validator;

/**
 *
 * @author lion
 * @date 2011-5-26
 *
 */
public abstract class Dic<T> {

	public String getNameById(String sid) {

		int id = Validator.toInt(sid, -1);

		if (id < 0) { return null; }

		return this.getNameById(id);
	}

	public abstract String getNameById(int id);

	public abstract List<T> getDicList();

	public T getDicById(String tmp) {

		int id = Validator.toInt(tmp, -1);

		if (id < 0) { return null; }

		return this.getDicById(id);
	}

	public abstract T getDicById(int id);
}
